package com.showtao.front.domain.converter;

import javax.persistence.AttributeConverter;

import com.showtao.common.security.enumeration.EUserStatus;
import com.showtao.common.util.EnumHelper;

public class EUserStatusConverter implements AttributeConverter<EUserStatus, String> {

    @Override
    public String convertToDatabaseColumn(EUserStatus attribute) {
        return attribute.getCode();
    }

    @Override
    public EUserStatus convertToEntityAttribute(String dbData) {
        return EnumHelper.translate(EUserStatus.class, dbData);
    }

}
